package com.city.repository.pub;

import com.city.domain.pub.PubHouseinfo;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;

import javax.persistence.*;
import java.util.List;
import java.util.Objects;

/**
 * @deprecation: 居民房屋信息
 * @dmail: 398521613@qq.com
 * @author: L-H
 * @date: 2018-07-21 18:54
 */
public interface PubHouseinfoRepository extends JpaRepository<PubHouseinfo,Integer> {

    @Query(value = "select * from pub_houseinfo order by id desc limit ?1,?2", nativeQuery = true)
    List<PubHouseinfo> getHouseinfoLimit(Integer limitPage, Integer limitNum);

    @Query(value = "select * from pub_houseinfo where id=?1", nativeQuery = true)
    PubHouseinfo getHouseinfo(Integer id);

    @Query(value = "select * from pub_houseinfo where lng !='' and lat !=''", nativeQuery = true)
    List<PubHouseinfo> getHouseinfoGIS();

    @Query(value = "select * from pub_houseinfo where id = ?1 and lng !='' and lat !=''", nativeQuery = true)
    PubHouseinfo getHouseinfoPosition(Integer id);



}
